<!DOCTYPE html>
<html >
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>11.15 用户管理系统</title>
    <link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  </head>
  <body ng-app="myApp" ng-controller="myController">
  
      <!-- 导航条 -->
  
        <nav class="navbar navbar-default" role="navigation">
          <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              <a class="navbar-brand" href="#">用户管理系统</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
              <ul class="nav navbar-nav">
                <li class="active"><a href="#">人员管理</a></li>
                <li><a href="#">Link</a></li>
              </ul>
            
              <ul class="nav navbar-nav navbar-right">
                <li><a href="#">Link</a></li>
                <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
                  <ul class="dropdown-menu" role="menu">
                    <li><a href="#">Action</a></li>
                    <li><a href="#">Another action</a></li>
                    <li><a href="#">Something else here</a></li>
                    <li class="divider"></li>
                    <li><a href="#">Separated link</a></li>
                  </ul>
                </li>
              </ul>
            </div><!-- /.navbar-collapse -->
          </div><!-- /.container-fluid -->
        </nav>
  
      <!-- 导航条 -->

      <div class="container">
        <div class="btn-group col-sm-6 pull-left">
          <button type="button" ng-click = "addBtn()" class="btn btn-default">新增</button>
        </div>

      <div class="col-sm-6 pull-right">
          <div class="input-group">
            <input ng-model = "query" type="text" class="form-control">
            <span class="input-group-btn">
              <button ng-click="searchBtn()" class="btn btn-default search" type="button">搜索</button>
            </span>
          </div><!-- /input-group -->
        </div><!-- /.col-lg-6 -->
        <table class="table table-bordered table-hover table-striped">
          <tr>
            <th>名字</th>
            <th>年龄</th> 
            <th>性别</th>
            <th>学历</th>
            <th>电话</th>
            <th>地址</th>
            <th>爱好</th>
            <th>操作</th>
          </tr>
        
        <tr ng-repeat = "user in users">
          <td>{{user.name}}</td>
          <td>{{user.age}}</td>
          <td>{{user.gender}}</td>
          <td>{{user.edu}}</td>
          <td>{{user.mobile}}</td>
          <td>{{user.address}}</td>
          <td>{{user.hobbies}}</td>
          <td><button ng-click="delBtn()">删除</button></td>
          <td><button ng-click="updataBtn()">修改</button></td>
        </tr>
        </table>
      <nav>
      <ul class="pagination pull-right">
        <li ng-click="firstClick()"><a href="#">&laquo;</a></li>
        <li ng-class="{true:'active'}[$index == currentIndex]" ng-click="pageClick()" ng-repeat="index in pageArr"><a href="#">{{$index + 1}}</a></li>
        <!-- <li class="active"><a href="#">1</a></li>
        <li><a href="#">2</a></li>
        <li><a href="#">3</a></li>
        <li><a href="#">4</a></li>
        <li><a href="#">5</a></li> -->
        <li ng-click="lastClick()"><a href="#">&raquo;</a></li>
      </ul>
    </nav> 

      </div><!-- /.row -->
     
      <div id='newDlg' class="modal fade">
        <div class="modal-dialog">
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
              <h4 class="modal-title">{{title}}</h4>
            </div>
            <div class="modal-body">
            <!--   表单 -->

              <form class="form-horizontal" role="form">
                <div class="form-group">
                  <label  class="col-sm-2 control-label">名字</label>
                  <div class="col-sm-3">
                    <input ng-model = "user.name" type="text" class="form-control">
                  </div>
                </div>
                <div class="form-group">
                  <label  class="col-sm-2 control-label">年龄</label>
                  <div class="col-sm-3">
                    <input ng-model = "user.age" type="text" class="form-control">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">性别</label>
                  <div class="col-sm-3">
                    <label class="radio-inline">
                      <input ng-model = "user.gender"  type="radio" checked name="inlineRadioOptions" id="inlineRadio1" value="option1"> 男
                    </label>
                    <label class="radio-inline">
                      <input ng-model = "user.gender" type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"> 女
                    </label>
                  </div>
                </div>
               
                <div class="form-group">
                  <label class="col-sm-2 control-label">学历</label>
                  <div class="col-sm-3">
                   <select ng-model = "user.edu" class="form-control">
                      <option>1</option>
                      <option>2</option>
                      <option>3</option>
                      <option>4</option>
                      <option>5</option>
                    </select>
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">电话</label>
                  <div class="col-sm-5">
                    <input ng-model = "user.mobile" type="text" class="form-control">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">地址</label>
                  <div class="col-sm-3">
                    <input ng-model = "user.address" type="text" class="form-control">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">爱好</label>
                  <div class="col-sm-3">
                    <label class="checkbox-inline">
                      <input ng-model = "user.hobbies" type="checkbox" id="inlineCheckbox1" value="hobbise1"> 1
                    </label>
                    <label class="checkbox-inline">
                      <input ng-model = "user.hobbies" type="checkbox" id="inlineCheckbox2" value="hobbise2"> 2
                    </label>
                    <label class="checkbox-inline">
                      <input ng-model = "user.hobbies" type="checkbox" id="inlineCheckbox3" value="hobbise3"> 3
                    </label>
                  </div>
                </div>
              </form>

             <!--  表单 -->

            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
              <button type="button" ng-show="!zhen" ng-click="saveBtn()" class="btn btn-primary">保存</button>
              <button type="button" ng-show="zhen" ng-click="dbUpdataBtn()" class="btn btn-primary">修改</button>
            </div>
          </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
      </div><!-- /.modal -->

    <script src="lib/jquery/dist/jquery.min.js"></script>
    <script src="lib/bootstrap/js/bootstrap.min.js"></script>
    <script src="lib/angular/angular.min.js"></script>
    <script src="js/index.js"></script>
  </body>
</html>
